package cn.edu.sdu.sol.material_management_system.model.po;

public enum Gender {

    MALE(0),
    FEMALE(1),
    UNKNOWN(2);

    private int value;

    Gender(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    public static Gender fromValue(int value) {
        for (Gender gender : Gender.values()) {
            if (gender.getValue() == value) {
                return gender;
            }
        }
        throw new IllegalArgumentException("无效的性别整数值：" + value);
    }
}
